package com.java1412.controller;

import com.java1412.boot.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author java1412
 * @create 2021-05-18 17:16
 */
@Controller
public class HelloController {
    @GetMapping(value = "show")
    public String show(Model model) {
        User user = new User();
        user.setName("java1412");
        user.setDesc("java1412教你Freemarker");
        model.addAttribute("user", user);
        return "ftl/index";
    }


    @GetMapping("/user/{id:\\d+}")
    public User get(@PathVariable String id) {
        throw new RuntimeException();
    }
}
